home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ADA Programming Guide
/
ADA Programming Guide.iso
/
adatutor
/
adawkbk
/
sol3-1.ada
< prev
next >
Wrap
Text File
|
1996-01-30
|
530b
|
32 lines
-- Problem 3.1
-- by Rick Conn
with Text_IO;
procedure Main is
package Int_IO is new Text_IO.Integer_IO (INTEGER);
begin
declare
Sum : INTEGER := 0;
procedure Display (Message : in STRING; Value : in INTEGER) is
begin
Text_IO.Put (Message & ": ");
Int_IO.Put (Value, 5);
Text_IO.New_Line;
end Display;
begin -- block
for I in 1 .. 10 loop
Sum := Sum + I;
Display ("The sum so far is", Sum);
end loop;
end; -- block
end Main;